package com.znxs.bs_c.common;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * author         软件21304赵鹏鑫
 * date           2023/8/16 15:50
 * Znxs~Product   [Result]
 **/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result {
    private Integer code;
    private String msg;
    private Object data;

    public static Result success(){
        return new Result(Status.SUCCESS.getCode(), Status.SUCCESS.getMessage(),null);
    }

    public static Result success(Object data){
        return new Result(Status.SUCCESS.getCode(),"",data);
    }

    public static Result error(){
        return new Result(Status.SystemError.getCode(), Status.SystemError.getMessage(),null);
    }

    public static Result error(Integer code,String msg){
        return new Result(code,msg, null);
    }


}
